#!/usr/bin/make -f
# -*- makefile -*-

# People Presence - Predesys service plugin
# Version: 0.1.2
# Author: Jose A. Jimenez <jajimc@gmail.com>
# License: GPL 3.0 (see "license" file)

NAME 			= predesys-people-presence

DEST_MAINDIR 	= /usr/share/$(NAME)

SRC_MAINDIR		= src
SRC_ABOUTFILE	= about
SRC_LICENSEFILE	= license

compile:

install:	basic-install

basic-install:
	# Directories creation
	mkdir -p $(DEST_MAINDIR)
	
	# Program files installation
	install -p -m 0644 $(SRC_MAINDIR)/*.py $(DEST_MAINDIR)
	install -p -m 0644 $(SRC_ABOUTFILE) $(DEST_MAINDIR)
	install -p -m 0644 $(SRC_LICENSEFILE) $(DEST_MAINDIR)

	# Service adding
	predesys-server services add -id peoplepresence -v "0.1.2" -tid "callable-user" -a 0 -e 1 -p /usr/share/predesys-people-presence/peoplepresence.py -name "People Presence" -author "Jose Antonio Jimenez Carmona <jajimc@gmail.com>"
	predesys-server serviceperms add -sid peoplepresence -gid client
uninstall:
	# Service removing
	predesys-server services del -f peoplepresence
	
	# Program files deletion
	rm -rf $(DEST_MAINDIR)
